#include "GS_Init.h"

#include "GameCore\Game.h"
#include "GameCore\GS_Loading_Template.h"
#include "GameCore\Texture.h"

#include "GameCore/SoundEngine/SoundManager.h"
#include "GameObjects\GameObjects.h"
#include "GameStates\GS_Play.h"


void GS_Init::Init()
{
	DXDevice::GetInstance()->SetProjectionOrthoMatrix(0.0f, DXDevice::GetInstance()->GetWidth(), 0.0f, DXDevice::GetInstance()->GetHeight(),1,100);
	DXDevice::GetInstance()->SetViewMatrix(0.0f,0.0f,0.0f,
												0.0f,0.0f,1.0f,
												0.0f,1.0f,0.0f);
	//---------------------------------------
	GS_Loading_Template* gs_Loading = new GS_Loading_Template();
	LoadingManager::GetInstance()->AddLoadingTextFile("Assets\\Data\\Ship.xml",&shipText);
	LoadingManager::GetInstance()->AddLoadingTextFile("Assets\\Data\\Bullet.xml",&bulletText);
	Game::GetInstance()->PushState(gs_Loading);
	
}
bool GS_Init::PostInit(int& step)
{
	GameObjectFactory::LoadShipInitialValue(shipText.c_str());
	Bullet::LoadBulletInitialValue(bulletText.c_str());
	return true;
}
void GS_Init::Release()
{
}
void GS_Init::Update(float timeTotal, float timeDelta)
{
	Game::GetInstance()->SwitchState(new GS_Play());
}
void GS_Init::Render()
{
}